import torch
from diffusers import StableDiffusion3Pipeline
from modelscope import snapshot_download

model_id = snapshot_download('AI-ModelScope/stable-diffusion-3.5-large')
pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipe = pipe.to("cuda")

image = pipe(
    "A capybara holding a sign that reads Hello World",
    num_inference_steps=28,
    guidance_scale=3.5,
).images[0]
image.save("capybara.png")